<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initAuth()
    {
        Zend_Auth::getInstance()->setStorage(
            new Application_Auth_Storage_Cookie()
        );
    }

    protected function _initAcl()
    {
        $acl = new Zend_Acl();
        $acl->addRole('guest')
            ->addRole('admin', 'guest');

        $acl->addResource('message');

        $acl->allow('admin', 'message', array('edit', 'delete'));
        $acl->allow('guest', 'message', array('edit', 'delete'),
                    new Application_Acl_Assert_MessageCreator());

        Zend_Registry::set('acl', $acl);
    }

    protected function _initControllerHelpers()
    {
        Zend_Controller_Action_HelperBroker::addPrefix('Application_Controller_Helper');
    }
}